package io.terminus.spzx.common.config.exception;

import io.terminus.spzx.model.vo.common.ResultCodeEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * @Author lichunlong lcl253137@alibaba-inc.com
 * @Desc 尚品甄选自定义异常类
 * @Date 2024-03-24
 */
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class SpzxCustomException extends RuntimeException {

    private Integer code;

    private String message;

    private ResultCodeEnum resultCode;

    public SpzxCustomException(ResultCodeEnum resultCode) {
        this.resultCode = resultCode;
        this.code = resultCode.getCode();
        this.message = resultCode.getMessage();
    }

}
